package com.caszx.chargingpile.utils;

import android.app.Activity;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.view.ViewGroup;

import com.caszx.chargingpile.R;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;

/**
 * Created by think on 2016/3/5.
 */
public class SnackbarHelp {


    public static  void showSnackbarMsg(Activity context, String text){
        SnackbarManager.show(
                Snackbar.with(context)
                        .color(context.getResources().getColor(R.color.colorAccent_tr))
                        .position(Snackbar.SnackbarPosition.TOP)
                        .margin(25, 15)
                        .text(text)
                ,(ViewGroup) context.findViewById(android.R.id.content));
    }

    public static   void showSnackbarMsg(Activity context,String text, ViewGroup parent){
        SnackbarManager.show(
                Snackbar.with(context)
                        .color(context.getResources().getColor(R.color.colorAccent_tr))
                        .position(Snackbar.SnackbarPosition.TOP)
                        .margin(25, 15)
                        .text(text)
                ,parent);
    }

}
